package com.zhoukun.cloud.service;


import com.zhoukun.cloud.CommentRest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;

/**
 * @author zhoukun 86547462@qq.com
 * @version 1.0
 * @date 2020/10/27 2:38
 */

/**
 * springcloud-payment-server服务提供者
 * springcloud-gatway服务网关
 * springcloud-payment-consument服务消费者
 */
//服务名使用网关名
@FeignClient(value = "springcloud-gatway",fallback = FeignServiceImpl.class)
public interface FeignService {
    //查询
    @GetMapping("/payment/query")
    public CommentRest query();

    //查询单个
    @GetMapping("/payment/queryById/{Id}")
    public CommentRest queryById(@PathVariable("Id") String Id);
    //修改余额
    @GetMapping("/payment/banUP/{Id}/{money}")
    public CommentRest banUP(@PathVariable("Id") String Id,
                             @PathVariable("money") BigDecimal money);

    //延时测试
    @GetMapping("/payment/outTime")
    public CommentRest outTime();

    //服务降级测试
    @GetMapping("/payment/demotion/{num}")
    public CommentRest demotion(@PathVariable("num") int num);

    //服务熔断测试
    @GetMapping("/payment/fusing/{num}")
    public CommentRest fusing(@PathVariable("num") int num);
}
